import { _decorator, UITransform, v3, Vec2, Vec3 } from "cc";
import { BattleObj } from "./BattleObj";
import { LogMgr } from "../../../framework/log/LogMgr";
const { ccclass ,property} = _decorator;

@ccclass("HeroObj")
export class HeroObj extends BattleObj{
    speed:number = 400;
    public tick(dt: number): void {
        if(this.isDie()){
            return;
        }
        if(this.moveDirecion.x!=0 || this.moveDirecion.y!=0){
            let move = this.moveDirecion.clone().multiplyScalar(this.speed*dt);
            // this.node.setPosition(this.node.position.add(v3(move.x,move.y,0)));
            // this.node.position.set(this.node.position.add(v3(move.x,move.y,0)))
            this.node.setPosition(this.node.position.add(v3(move.x,move.y,0)))
        }
    }
}